home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / livelabl / livelabe.exe / LNUMBER.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-07-22  |  13.0 KB  |  406 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Live Number Example"
  5.    ClientHeight    =   5340
  6.    ClientLeft      =   2235
  7.    ClientTop       =   2145
  8.    ClientWidth     =   5760
  9.    Height          =   5745
  10.    Icon            =   "LNumber.frx":0000
  11.    Left            =   2175
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   5340
  16.    ScaleWidth      =   5760
  17.    Top             =   1800
  18.    Width           =   5880
  19.    Begin VB.ComboBox cboDigitCount 
  20.       Height          =   315
  21.       ItemData        =   "LNumber.frx":08CA
  22.       Left            =   180
  23.       List            =   "LNumber.frx":08DD
  24.       Sorted          =   -1  'True
  25.       Style           =   2  'Dropdown List
  26.       TabIndex        =   7
  27.       Top             =   2745
  28.       Width           =   1455
  29.    End
  30.    Begin VB.Frame Frame1 
  31.       Caption         =   "Live Number Control"
  32.       Height          =   4515
  33.       Left            =   45
  34.       TabIndex        =   0
  35.       Top             =   810
  36.       Width           =   5685
  37.       Begin VB.CommandButton cmdSample1 
  38.          Caption         =   "Sample &1"
  39.          Height          =   375
  40.          Left            =   135
  41.          TabIndex        =   25
  42.          Top             =   4050
  43.          Width           =   1275
  44.       End
  45.       Begin VB.ComboBox cboDelay 
  46.          Height          =   315
  47.          ItemData        =   "LNumber.frx":08F0
  48.          Left            =   2745
  49.          List            =   "LNumber.frx":0909
  50.          Style           =   2  'Dropdown List
  51.          TabIndex        =   23
  52.          Top             =   1935
  53.          Width           =   1050
  54.       End
  55.       Begin VB.CommandButton cmdApply 
  56.          Caption         =   "&Apply"
  57.          Height          =   330
  58.          Left            =   3825
  59.          TabIndex        =   22
  60.          Top             =   3240
  61.          Width           =   825
  62.       End
  63.       Begin VB.TextBox txtValue 
  64.          Height          =   330
  65.          Left            =   2070
  66.          MaxLength       =   5
  67.          TabIndex        =   20
  68.          Top             =   3240
  69.          Width           =   1680
  70.       End
  71.       Begin VB.ComboBox cboFont 
  72.          Height          =   315
  73.          ItemData        =   "LNumber.frx":0924
  74.          Left            =   135
  75.          List            =   "LNumber.frx":092B
  76.          Sorted          =   -1  'True
  77.          Style           =   2  'Dropdown List
  78.          TabIndex        =   18
  79.          Top             =   3240
  80.          Width           =   1860
  81.       End
  82.       Begin VB.CheckBox chkDigitsMoveUp 
  83.          Caption         =   "Digits Move &Up"
  84.          Height          =   240
  85.          Left            =   135
  86.          TabIndex        =   17
  87.          Top             =   1215
  88.          Value           =   1  'Checked
  89.          Width           =   1905
  90.       End
  91.       Begin VB.CommandButton cmdExit 
  92.          Caption         =   "E&xit"
  93.          Height          =   375
  94.          Left            =   4455
  95.          TabIndex        =   16
  96.          Top             =   4050
  97.          Width           =   1140
  98.       End
  99.       Begin VB.CommandButton cmdResetValue 
  100.          Caption         =   "&Reset Value"
  101.          Height          =   375
  102.          Left            =   4410
  103.          TabIndex        =   15
  104.          Top             =   180
  105.          Width           =   1185
  106.       End
  107.       Begin VB.ComboBox cboSpeed 
  108.          Height          =   315
  109.          ItemData        =   "LNumber.frx":093E
  110.          Left            =   1665
  111.          List            =   "LNumber.frx":0951
  112.          Sorted          =   -1  'True
  113.          Style           =   2  'Dropdown List
  114.          TabIndex        =   13
  115.          Top             =   1935
  116.          Width           =   1005
  117.       End
  118.       Begin VB.ComboBox cboTop 
  119.          Height          =   315
  120.          ItemData        =   "LNumber.frx":0964
  121.          Left            =   1665
  122.          List            =   "LNumber.frx":097A
  123.          Sorted          =   -1  'True
  124.          Style           =   2  'Dropdown List
  125.          TabIndex        =   12
  126.          Top             =   2565
  127.          Width           =   2130
  128.       End
  129.       Begin VB.ComboBox cboSide 
  130.          Height          =   315
  131.          ItemData        =   "LNumber.frx":0990
  132.          Left            =   135
  133.          List            =   "LNumber.frx":09A6
  134.          Sorted          =   -1  'True
  135.          Style           =   2  'Dropdown List
  136.          TabIndex        =   10
  137.          Top             =   2565
  138.          Width           =   1455
  139.       End
  140.       Begin VB.CheckBox chkDigitChanging 
  141.          Caption         =   "Digit C&hanging Sound"
  142.          Height          =   240
  143.          Left            =   135
  144.          TabIndex        =   6
  145.          Top             =   900
  146.          Value           =   1  'Checked
  147.          Width           =   1905
  148.       End
  149.       Begin VB.CheckBox chkDigitChanged 
  150.          Caption         =   "Di&git Changed Sound"
  151.          Height          =   240
  152.          Left            =   135
  153.          TabIndex        =   5
  154.          Top             =   585
  155.          Value           =   1  'Checked
  156.          Width           =   1950
  157.       End
  158.       Begin VB.CommandButton cmdTextColor 
  159.          Caption         =   "&Text Color"
  160.          Height          =   375
  161.          Left            =   4410
  162.          TabIndex        =   4
  163.          Top             =   1395
  164.          Width           =   1185
  165.       End
  166.       Begin VB.CommandButton cmdDigitColor 
  167.          Caption         =   "&Digit Color"
  168.          Height          =   375
  169.          Left            =   4410
  170.          TabIndex        =   3
  171.          Top             =   990
  172.          Width           =   1185
  173.       End
  174.       Begin VB.CommandButton cmdBackColor 
  175.          Caption         =   "&Border Color"
  176.          Height          =   375
  177.          Left            =   4410
  178.          TabIndex        =   2
  179.          Top             =   585
  180.          Width           =   1185
  181.       End
  182.       Begin VB.CheckBox chkCounterActive 
  183.          Caption         =   "&Active"
  184.          Height          =   240
  185.          Left            =   135
  186.          TabIndex        =   1
  187.          Top             =   270
  188.          Value           =   1  'Checked
  189.          Width           =   1590
  190.       End
  191.       Begin VB.Label Label8 
  192.          AutoSize        =   -1  'True
  193.          BackColor       =   &H00C0C0C0&
  194.          Caption         =   "Real Life Sample"
  195.          ForeColor       =   &H00800000&
  196.          Height          =   195
  197.          Left            =   135
  198.          TabIndex        =   26
  199.          Top             =   3825
  200.          Width           =   1290
  201.          WordWrap        =   -1  'True
  202.       End
  203.       Begin VB.Label Label7 
  204.          AutoSize        =   -1  'True
  205.          Caption         =   "Digit Delay"
  206.          Height          =   195
  207.          Left            =   2745
  208.          TabIndex        =   24
  209.          Top             =   1710
  210.          Width           =   765
  211.       End
  212.       Begin VB.Label Label6 
  213.          AutoSize        =   -1  'True
  214.          Caption         =   "Change Value"
  215.          Height          =   195
  216.          Left            =   2070
  217.          TabIndex        =   21
  218.          Top             =   3015
  219.          Width           =   1005
  220.       End
  221.       Begin VB.Label Label5 
  222.          AutoSize        =   -1  'True
  223.          Caption         =   "Font"
  224.          Height          =   195
  225.          Left            =   135
  226.          TabIndex        =   19
  227.          Top             =   3015
  228.          Width           =   315
  229.       End
  230.       Begin VB.Label Label4 
  231.          AutoSize        =   -1  'True
  232.          Caption         =   "Digit Speed"
  233.          Height          =   195
  234.          Left            =   1665
  235.          TabIndex        =   14
  236.          Top             =   1710
  237.          Width           =   825
  238.       End
  239.       Begin VB.Label Label3 
  240.          AutoSize        =   -1  'True
  241.          Caption         =   "Digit Top Bottom Margins"
  242.          Height          =   195
  243.          Left            =   1665
  244.          TabIndex        =   11
  245.          Top             =   2340
  246.          Width           =   1785
  247.       End
  248.       Begin VB.Label Label2 
  249.          AutoSize        =   -1  'True
  250.          Caption         =   "Digit Side Margins"
  251.          Height          =   195
  252.          Left            =   135
  253.          TabIndex        =   9
  254.          Top             =   2340
  255.          Width           =   1275
  256.       End
  257.       Begin VB.Label Label1 
  258.          AutoSize        =   -1  'True
  259.          Caption         =   "Digit Count"
  260.          Height          =   195
  261.          Left            =   135
  262.          TabIndex        =   8
  263.          Top             =   1710
  264.          Width           =   780
  265.       End
  266.    End
  267.    Begin VB.Timer Timer1 
  268.       Interval        =   3000
  269.       Left            =   5310
  270.       Top             =   45
  271.    End
  272.    Begin LiveLabelsLib.LiveNumber LiveNumber1 
  273.       Height          =   690
  274.       Left            =   45
  275.       TabIndex        =   27
  276.       Top             =   45
  277.       Width           =   3075
  278.       _Version        =   65536
  279.       _ExtentX        =   5424
  280.       _ExtentY        =   1217
  281.       _StockProps     =   41
  282.       ForeColor       =   16777215
  283.       BackColor       =   0
  284.       DigitBackColor  =   49152
  285.       DigitSpeed      =   2
  286.       BeginProperty DigitFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  287.          Name            =   "Comic Sans MS"
  288.          Size            =   24
  289.          Charset         =   0
  290.          Weight          =   700
  291.          Underline       =   0   'False
  292.          Italic          =   0   'False
  293.          Strikethrough   =   0   'False
  294.       EndProperty
  295.    End
  296.    Begin MSComDlg.CommonDialog dlgMain 
  297.       Left            =   4770
  298.       Top             =   45
  299.       _ExtentX        =   847
  300.       _ExtentY        =   847
  301.       _Version        =   327681
  302.    End
  303. Attribute VB_Name = "frmMain"
  304. Attribute VB_Creatable = False
  305. Attribute VB_Exposed = False
  306. Option Explicit
  307. Private Sub cboDelay_Click()
  308.     LiveNumber1.DigitDelay = Val(cboDelay.List(cboDelay.ListIndex))
  309. End Sub
  310. Private Sub cboDigitCount_Click()
  311.     LiveNumber1.DigitCount = Val(cboDigitCount.List(cboDigitCount.ListIndex))
  312. End Sub
  313. Private Sub cboFont_Click()
  314.     LiveNumber1.DigitFont.Name = cboFont.List(cboFont.ListIndex)
  315. End Sub
  316. Private Sub cboSide_Click()
  317.     LiveNumber1.DigitSideMargin = Val(cboSide.List(cboSide.ListIndex))
  318. End Sub
  319. Private Sub cboSpeed_Click()
  320.     LiveNumber1.DigitSpeed = Val(cboSpeed.List(cboSpeed.ListIndex))
  321. End Sub
  322. Private Sub cboTop_Click()
  323.     LiveNumber1.DigitTopMargin = Val(cboTop.List(cboTop.ListIndex))
  324. End Sub
  325. Private Sub chkCounterActive_Click()
  326.     Timer1.Enabled = (chkCounterActive.Value = 1)
  327. End Sub
  328. Private Sub chkDigitChanging_Click()
  329.     With LiveNumber1
  330.         
  331.         If (chkDigitChanging.Value = 0) Then
  332.             .DigitChangingSound = ""
  333.         Else
  334.             .DigitChangingSound = App.Path & "\" & "Turn.WAV"
  335.         End If
  336.     End With
  337. End Sub
  338. Private Sub chkDigitChanged_Click()
  339.     With LiveNumber1
  340.         If (chkDigitChanged.Value = 0) Then
  341.             .DigitChangedSound = ""
  342.         Else
  343.             .DigitChangedSound = App.Path & "\" & "Tick.WAV"
  344.         End If
  345.     End With
  346. End Sub
  347. Private Sub chkDigitsMoveUp_Click()
  348.     LiveNumber1.DigitsMoveUp = (chkDigitsMoveUp.Value = 1)
  349. End Sub
  350. Private Sub cmdApply_Click()
  351.     If Trim(txtValue.Text) = "" Then txtValue.Text = "0"
  352.     LiveNumber1.Value = Val(txtValue.Text)
  353. End Sub
  354. Private Sub cmdBackColor_Click()
  355.     With dlgMain
  356.       .Action = 3
  357.       If .CancelError Then Exit Sub
  358.       LiveNumber1.BackColor = .Color
  359.     End With
  360. End Sub
  361. Private Sub cmdDigitColor_Click()
  362.     With dlgMain
  363.       .Action = 3
  364.       If .CancelError Then Exit Sub
  365.       LiveNumber1.DigitBackColor = .Color
  366.     End With
  367. End Sub
  368. Private Sub cmdExit_Click()
  369.     Unload Me
  370. End Sub
  371. Private Sub cmdResetValue_Click()
  372.     LiveNumber1.Value = 0
  373. End Sub
  374. Private Sub cmdSample1_Click()
  375.     Load frmSample1
  376.     frmSample1.Show vbModal
  377. End Sub
  378. Private Sub cmdTextColor_Click()
  379.     With dlgMain
  380.       .Action = 3
  381.       If .CancelError Then Exit Sub
  382.       LiveNumber1.ForeColor = .Color
  383.     End With
  384. End Sub
  385. Private Sub Form_Load()
  386.     chkDigitChanged_Click
  387.     chkDigitChanging_Click
  388.     cboFont.ListIndex = 0
  389.     cboDigitCount.ListIndex = 3
  390.     cboSide.ListIndex = 1
  391.     cboTop.ListIndex = 2
  392.     cboSpeed.ListIndex = 0
  393.     cboDelay.ListIndex = 0
  394.     Dim Cnt As Long
  395.     For Cnt = 0 To Screen.FontCount
  396.       cboFont.AddItem Screen.Fonts(Cnt)
  397.     Next
  398. End Sub
  399. Private Sub Timer1_Timer()
  400.     LiveNumber1.Add 1
  401. End Sub
  402. Private Sub txtValue_KeyPress(KeyAscii As Integer)
  403.     If (KeyAscii = 8 Or (KeyAscii <= Asc("9") And KeyAscii >= Asc("0"))) Then Exit Sub
  404.     KeyAscii = 0
  405. End Sub
  406.